{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"id\", \"prefixCls\", \"value\", \"defaultValue\", \"onChange\", \"onSelect\", \"onDeselect\", \"searchValue\", \"inputValue\", \"onSearch\", \"autoClearSearchValue\", \"filterTreeNode\", \"treeNodeFilterProp\", \"showCheckedStrategy\", \"treeNodeLabelProp\", \"multiple\", \"treeCheckable\", \"treeCheckStrictly\", \"labelInValue\", \"fieldNames\", \"treeDataSimpleMode\", \"treeData\", \"children\", \"loadData\", \"treeLoadedKeys\", \"onTreeLoad\", \"treeDefaultExpandAll\", \"treeExpandedKeys\", \"treeDefaultExpandedKeys\", \"onTreeExpand\", \"treeExpandAction\", \"virtual\", \"listHeight\", \"listItemHeight\", \"onDropdownVisibleChange\", \"dropdownMatchSelectWidth\", \"treeLine\", \"treeIcon\", \"showTreeIcon\", \"switcherIcon\", \"treeMotion\"];\nimport * as React from 'react';\nimport { BaseSelect } from 'rc-select';\nimport { conductCheck } from \"rc-tree/es/utils/conductUtil\";\nimport useId from \"rc-select/es/hooks/useId\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport OptionList from \"./OptionList\";\nimport TreeNode from \"./TreeNode\";\nimport { formatStrategyValues, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from \"./utils/strategyUtil\";\nimport TreeSelectContext from \"./TreeSelectContext\";\nimport LegacyContext from \"./LegacyContext\";\nimport useTreeData from \"./hooks/useTreeData\";\nimport { toArray, fillFieldNames, isNil } from \"./utils/valueUtil\";\nimport useCache from \"./hooks/useCache\";\nimport useRefFunc from \"./hooks/useRefFunc\";\nimport useDataEntities from \"./hooks/useDataEntities\";\nimport { fillAdditionalInfo, fillLegacyProps } from \"./utils/legacyUtil\";\nimport useCheckedKeys from \"./hooks/useCheckedKeys\";\nimport useFilterTreeData from \"./hooks/useFilterTreeData\";\nimport warningProps from \"./utils/warningPropsUtil\";\nimport warning from \"rc-util/es/warning\";\nfunction isRawValue(value) {\n  return !value || _typeof(value) !== 'object';\n}\nvar TreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var id = props.id,\n    _props$prefixCls = props.prefixCls,\n    prefixCls = _props$prefixCls === void 0 ? 'rc-tree-select' : _props$prefixCls,\n    value = props.value,\n    defaultValue = props.defaultValue,\n    onChange = props.onChange,\n    onSelect = props.onSelect,\n    onDeselect = props.onDeselect,\n    searchValue = props.searchValue,\n    inputValue = props.inputValue,\n    onSearch = props.onSearch,\n    _props$autoClearSearc = props.autoClearSearchValue,\n    autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n    filterTreeNode = props.filterTreeNode,\n    _props$treeNodeFilter = props.treeNodeFilterProp,\n    treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'value' : _props$treeNodeFilter,\n    _props$showCheckedStr = props.showCheckedStrategy,\n    showCheckedStrategy = _props$showCheckedStr === void 0 ? SHOW_CHILD : _props$showCheckedStr,\n    treeNodeLabelProp = props.treeNodeLabelProp,\n    multiple = props.multiple,\n    treeCheckable = props.treeCheckable,\n    treeCheckStrictly = props.treeCheckStrictly,\n    labelInValue = props.labelInValue,\n    fieldNames = props.fieldNames,\n    treeDataSimpleMode = props.treeDataSimpleMode,\n    treeData = props.treeData,\n    children = props.children,\n    loadData = props.loadData,\n    treeLoadedKeys = props.treeLoadedKeys,\n    onTreeLoad = props.onTreeLoad,\n    treeDefaultExpandAll = props.treeDefaultExpandAll,\n    treeExpandedKeys = props.treeExpandedKeys,\n    treeDefaultExpandedKeys = props.treeDefaultExpandedKeys,\n    onTreeExpand = props.onTreeExpand,\n    treeExpandAction = props.treeExpandAction,\n    virtual = props.virtual,\n    _props$listHeight = props.listHeight,\n    listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n    _props$listItemHeight = props.listItemHeight,\n    listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n    onDropdownVisibleChange = props.onDropdownVisibleChange,\n    _props$dropdownMatchS = props.dropdownMatchSelectWidth,\n    dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,\n    treeLine = props.treeLine,\n    treeIcon = props.treeIcon,\n    showTreeIcon = props.showTreeIcon,\n    switcherIcon = props.switcherIcon,\n    treeMotion = props.treeMotion,\n    restProps = _objectWithoutProperties(props, _excluded);\n  var mergedId = useId(id);\n  var treeConduction = treeCheckable && !treeCheckStrictly;\n  var mergedCheckable = treeCheckable || treeCheckStrictly;\n  var mergedLabelInValue = treeCheckStrictly || labelInValue;\n  var mergedMultiple = mergedCheckable || multiple;\n  var _useMergedState = useMergedState(defaultValue, {\n      value: value\n    }),\n    _useMergedState2 = _slicedToArray(_useMergedState, 2),\n    internalValue = _useMergedState2[0],\n    setInternalValue = _useMergedState2[1]; // ========================== Warning ===========================\n\n  if (process.env.NODE_ENV !== 'production') {\n    warningProps(props);\n  } // ========================= FieldNames =========================\n\n  var mergedFieldNames = React.useMemo(function () {\n    return fillFieldNames(fieldNames);\n  }, /* eslint-disable react-hooks/exhaustive-deps */\n  [JSON.stringify(fieldNames)]\n  /* eslint-enable react-hooks/exhaustive-deps */); // =========================== Search ===========================\n\n  var _useMergedState3 = useMergedState('', {\n      value: searchValue !== undefined ? searchValue : inputValue,\n      postState: function postState(search) {\n        return search || '';\n      }\n    }),\n    _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n    mergedSearchValue = _useMergedState4[0],\n    setSearchValue = _useMergedState4[1];\n  var onInternalSearch = function onInternalSearch(searchText) {\n    setSearchValue(searchText);\n    onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);\n  }; // ============================ Data ============================\n  // `useTreeData` only do convert of `children` or `simpleMode`.\n  // Else will return origin `treeData` for perf consideration.\n  // Do not do anything to loop the data.\n\n  var mergedTreeData = useTreeData(treeData, children, treeDataSimpleMode);\n  var _useDataEntities = useDataEntities(mergedTreeData, mergedFieldNames),\n    keyEntities = _useDataEntities.keyEntities,\n    valueEntities = _useDataEntities.valueEntities;\n  /** Get `missingRawValues` which not exist in the tree yet */\n\n  var splitRawValues = React.useCallback(function (newRawValues) {\n    var missingRawValues = [];\n    var existRawValues = []; // Keep missing value in the cache\n\n    newRawValues.forEach(function (val) {\n      if (valueEntities.has(val)) {\n        existRawValues.push(val);\n      } else {\n        missingRawValues.push(val);\n      }\n    });\n    return {\n      missingRawValues: missingRawValues,\n      existRawValues: existRawValues\n    };\n  }, [valueEntities]); // Filtered Tree\n\n  var filteredTreeData = useFilterTreeData(mergedTreeData, mergedSearchValue, {\n    fieldNames: mergedFieldNames,\n    treeNodeFilterProp: treeNodeFilterProp,\n    filterTreeNode: filterTreeNode\n  }); // =========================== Label ============================\n\n  var getLabel = React.useCallback(function (item) {\n    if (item) {\n      if (treeNodeLabelProp) {\n        return item[treeNodeLabelProp];\n      } // Loop from fieldNames\n\n      var titleList = mergedFieldNames._title;\n      for (var i = 0; i < titleList.length; i += 1) {\n        var title = item[titleList[i]];\n        if (title !== undefined) {\n          return title;\n        }\n      }\n    }\n  }, [mergedFieldNames, treeNodeLabelProp]); // ========================= Wrap Value =========================\n\n  var toLabeledValues = React.useCallback(function (draftValues) {\n    var values = toArray(draftValues);\n    return values.map(function (val) {\n      if (isRawValue(val)) {\n        return {\n          value: val\n        };\n      }\n      return val;\n    });\n  }, []);\n  var convert2LabelValues = React.useCallback(function (draftValues) {\n    var values = toLabeledValues(draftValues);\n    return values.map(function (item) {\n      var rawLabel = item.label;\n      var rawValue = item.value,\n        rawHalfChecked = item.halfChecked;\n      var rawDisabled;\n      var entity = valueEntities.get(rawValue); // Fill missing label & status\n\n      if (entity) {\n        var _rawLabel;\n        rawLabel = (_rawLabel = rawLabel) !== null && _rawLabel !== void 0 ? _rawLabel : getLabel(entity.node);\n        rawDisabled = entity.node.disabled;\n      } else if (rawLabel === undefined) {\n        // We try to find in current `labelInValue` value\n        var labelInValueItem = toLabeledValues(internalValue).find(function (labeledItem) {\n          return labeledItem.value === rawValue;\n        });\n        rawLabel = labelInValueItem.label;\n      }\n      return {\n        label: rawLabel,\n        value: rawValue,\n        halfChecked: rawHalfChecked,\n        disabled: rawDisabled\n      };\n    });\n  }, [valueEntities, getLabel, toLabeledValues, internalValue]); // =========================== Values ===========================\n\n  var rawMixedLabeledValues = React.useMemo(function () {\n    return toLabeledValues(internalValue);\n  }, [toLabeledValues, internalValue]); // Split value into full check and half check\n\n  var _React$useMemo = React.useMemo(function () {\n      var fullCheckValues = [];\n      var halfCheckValues = [];\n      rawMixedLabeledValues.forEach(function (item) {\n        if (item.halfChecked) {\n          halfCheckValues.push(item);\n        } else {\n          fullCheckValues.push(item);\n        }\n      });\n      return [fullCheckValues, halfCheckValues];\n    }, [rawMixedLabeledValues]),\n    _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n    rawLabeledValues = _React$useMemo2[0],\n    rawHalfLabeledValues = _React$useMemo2[1]; // const [mergedValues] = useCache(rawLabeledValues);\n\n  var rawValues = React.useMemo(function () {\n    return rawLabeledValues.map(function (item) {\n      return item.value;\n    });\n  }, [rawLabeledValues]); // Convert value to key. Will fill missed keys for conduct check.\n\n  var _useCheckedKeys = useCheckedKeys(rawLabeledValues, rawHalfLabeledValues, treeConduction, keyEntities),\n    _useCheckedKeys2 = _slicedToArray(_useCheckedKeys, 2),\n    rawCheckedValues = _useCheckedKeys2[0],\n    rawHalfCheckedValues = _useCheckedKeys2[1]; // Convert rawCheckedKeys to check strategy related values\n\n  var displayValues = React.useMemo(function () {\n    // Collect keys which need to show\n    var displayKeys = formatStrategyValues(rawCheckedValues, showCheckedStrategy, keyEntities, mergedFieldNames); // Convert to value and filled with label\n\n    var values = displayKeys.map(function (key) {\n      var _keyEntities$key$node, _keyEntities$key, _keyEntities$key$node2;\n      return (_keyEntities$key$node = (_keyEntities$key = keyEntities[key]) === null || _keyEntities$key === void 0 ? void 0 : (_keyEntities$key$node2 = _keyEntities$key.node) === null || _keyEntities$key$node2 === void 0 ? void 0 : _keyEntities$key$node2[mergedFieldNames.value]) !== null && _keyEntities$key$node !== void 0 ? _keyEntities$key$node : key;\n    }); // Back fill with origin label\n\n    var labeledValues = values.map(function (val) {\n      var targetItem = rawLabeledValues.find(function (item) {\n        return item.value === val;\n      });\n      return {\n        value: val,\n        label: targetItem === null || targetItem === void 0 ? void 0 : targetItem.label\n      };\n    });\n    var rawDisplayValues = convert2LabelValues(labeledValues);\n    var firstVal = rawDisplayValues[0];\n    if (!mergedMultiple && firstVal && isNil(firstVal.value) && isNil(firstVal.label)) {\n      return [];\n    }\n    return rawDisplayValues.map(function (item) {\n      var _item$label;\n      return _objectSpread(_objectSpread({}, item), {}, {\n        label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value\n      });\n    });\n  }, [mergedFieldNames, mergedMultiple, rawCheckedValues, rawLabeledValues, convert2LabelValues, showCheckedStrategy, keyEntities]);\n  var _useCache = useCache(displayValues),\n    _useCache2 = _slicedToArray(_useCache, 1),\n    cachedDisplayValues = _useCache2[0]; // =========================== Change ===========================\n\n  var triggerChange = useRefFunc(function (newRawValues, extra, source) {\n    var labeledValues = convert2LabelValues(newRawValues);\n    setInternalValue(labeledValues); // Clean up if needed\n\n    if (autoClearSearchValue) {\n      setSearchValue('');\n    } // Generate rest parameters is costly, so only do it when necessary\n\n    if (onChange) {\n      var eventValues = newRawValues;\n      if (treeConduction) {\n        var formattedKeyList = formatStrategyValues(newRawValues, showCheckedStrategy, keyEntities, mergedFieldNames);\n        eventValues = formattedKeyList.map(function (key) {\n          var entity = valueEntities.get(key);\n          return entity ? entity.node[mergedFieldNames.value] : key;\n        });\n      }\n      var _ref = extra || {\n          triggerValue: undefined,\n          selected: undefined\n        },\n        triggerValue = _ref.triggerValue,\n        selected = _ref.selected;\n      var returnRawValues = eventValues; // We need fill half check back\n\n      if (treeCheckStrictly) {\n        var halfValues = rawHalfLabeledValues.filter(function (item) {\n          return !eventValues.includes(item.value);\n        });\n        returnRawValues = [].concat(_toConsumableArray(returnRawValues), _toConsumableArray(halfValues));\n      }\n      var returnLabeledValues = convert2LabelValues(returnRawValues);\n      var additionalInfo = {\n        // [Legacy] Always return as array contains label & value\n        preValue: rawLabeledValues,\n        triggerValue: triggerValue\n      }; // [Legacy] Fill legacy data if user query.\n      // This is expansive that we only fill when user query\n      // https://github.com/react-component/tree-select/blob/fe33eb7c27830c9ac70cd1fdb1ebbe7bc679c16a/src/Select.jsx\n\n      var showPosition = true;\n      if (treeCheckStrictly || source === 'selection' && !selected) {\n        showPosition = false;\n      }\n      fillAdditionalInfo(additionalInfo, triggerValue, newRawValues, mergedTreeData, showPosition, mergedFieldNames);\n      if (mergedCheckable) {\n        additionalInfo.checked = selected;\n      } else {\n        additionalInfo.selected = selected;\n      }\n      var returnValues = mergedLabelInValue ? returnLabeledValues : returnLabeledValues.map(function (item) {\n        return item.value;\n      });\n      onChange(mergedMultiple ? returnValues : returnValues[0], mergedLabelInValue ? null : returnLabeledValues.map(function (item) {\n        return item.label;\n      }), additionalInfo);\n    }\n  }); // ========================== Options ===========================\n\n  /** Trigger by option list */\n\n  var onOptionSelect = React.useCallback(function (selectedKey, _ref2) {\n    var _node$mergedFieldName;\n    var selected = _ref2.selected,\n      source = _ref2.source;\n    var entity = keyEntities[selectedKey];\n    var node = entity === null || entity === void 0 ? void 0 : entity.node;\n    var selectedValue = (_node$mergedFieldName = node === null || node === void 0 ? void 0 : node[mergedFieldNames.value]) !== null && _node$mergedFieldName !== void 0 ? _node$mergedFieldName : selectedKey; // Never be falsy but keep it safe\n\n    if (!mergedMultiple) {\n      // Single mode always set value\n      triggerChange([selectedValue], {\n        selected: true,\n        triggerValue: selectedValue\n      }, 'option');\n    } else {\n      var newRawValues = selected ? [].concat(_toConsumableArray(rawValues), [selectedValue]) : rawCheckedValues.filter(function (v) {\n        return v !== selectedValue;\n      }); // Add keys if tree conduction\n\n      if (treeConduction) {\n        // Should keep missing values\n        var _splitRawValues = splitRawValues(newRawValues),\n          missingRawValues = _splitRawValues.missingRawValues,\n          existRawValues = _splitRawValues.existRawValues;\n        var keyList = existRawValues.map(function (val) {\n          return valueEntities.get(val).key;\n        }); // Conduction by selected or not\n\n        var checkedKeys;\n        if (selected) {\n          var _conductCheck = conductCheck(keyList, true, keyEntities);\n          checkedKeys = _conductCheck.checkedKeys;\n        } else {\n          var _conductCheck2 = conductCheck(keyList, {\n            checked: false,\n            halfCheckedKeys: rawHalfCheckedValues\n          }, keyEntities);\n          checkedKeys = _conductCheck2.checkedKeys;\n        } // Fill back of keys\n\n        newRawValues = [].concat(_toConsumableArray(missingRawValues), _toConsumableArray(checkedKeys.map(function (key) {\n          return keyEntities[key].node[mergedFieldNames.value];\n        })));\n      }\n      triggerChange(newRawValues, {\n        selected: selected,\n        triggerValue: selectedValue\n      }, source || 'option');\n    } // Trigger select event\n\n    if (selected || !mergedMultiple) {\n      onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedValue, fillLegacyProps(node));\n    } else {\n      onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectedValue, fillLegacyProps(node));\n    }\n  }, [splitRawValues, valueEntities, keyEntities, mergedFieldNames, mergedMultiple, rawValues, triggerChange, treeConduction, onSelect, onDeselect, rawCheckedValues, rawHalfCheckedValues]); // ========================== Dropdown ==========================\n\n  var onInternalDropdownVisibleChange = React.useCallback(function (open) {\n    if (onDropdownVisibleChange) {\n      var legacyParam = {};\n      Object.defineProperty(legacyParam, 'documentClickClose', {\n        get: function get() {\n          warning(false, 'Second param of `onDropdownVisibleChange` has been removed.');\n          return false;\n        }\n      });\n      onDropdownVisibleChange(open, legacyParam);\n    }\n  }, [onDropdownVisibleChange]); // ====================== Display Change ========================\n\n  var onDisplayValuesChange = useRefFunc(function (newValues, info) {\n    var newRawValues = newValues.map(function (item) {\n      return item.value;\n    });\n    if (info.type === 'clear') {\n      triggerChange(newRawValues, {}, 'selection');\n      return;\n    } // TreeSelect only have multiple mode which means display change only has remove\n\n    if (info.values.length) {\n      onOptionSelect(info.values[0].value, {\n        selected: false,\n        source: 'selection'\n      });\n    }\n  }); // ========================== Context ===========================\n\n  var treeSelectContext = React.useMemo(function () {\n    return {\n      virtual: virtual,\n      dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n      listHeight: listHeight,\n      listItemHeight: listItemHeight,\n      treeData: filteredTreeData,\n      fieldNames: mergedFieldNames,\n      onSelect: onOptionSelect,\n      treeExpandAction: treeExpandAction\n    };\n  }, [virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, filteredTreeData, mergedFieldNames, onOptionSelect, treeExpandAction]); // ======================= Legacy Context =======================\n\n  var legacyContext = React.useMemo(function () {\n    return {\n      checkable: mergedCheckable,\n      loadData: loadData,\n      treeLoadedKeys: treeLoadedKeys,\n      onTreeLoad: onTreeLoad,\n      checkedKeys: rawCheckedValues,\n      halfCheckedKeys: rawHalfCheckedValues,\n      treeDefaultExpandAll: treeDefaultExpandAll,\n      treeExpandedKeys: treeExpandedKeys,\n      treeDefaultExpandedKeys: treeDefaultExpandedKeys,\n      onTreeExpand: onTreeExpand,\n      treeIcon: treeIcon,\n      treeMotion: treeMotion,\n      showTreeIcon: showTreeIcon,\n      switcherIcon: switcherIcon,\n      treeLine: treeLine,\n      treeNodeFilterProp: treeNodeFilterProp,\n      keyEntities: keyEntities\n    };\n  }, [mergedCheckable, loadData, treeLoadedKeys, onTreeLoad, rawCheckedValues, rawHalfCheckedValues, treeDefaultExpandAll, treeExpandedKeys, treeDefaultExpandedKeys, onTreeExpand, treeIcon, treeMotion, showTreeIcon, switcherIcon, treeLine, treeNodeFilterProp, keyEntities]); // =========================== Render ===========================\n\n  return /*#__PURE__*/React.createElement(TreeSelectContext.Provider, {\n    value: treeSelectContext\n  }, /*#__PURE__*/React.createElement(LegacyContext.Provider, {\n    value: legacyContext\n  }, /*#__PURE__*/React.createElement(BaseSelect, _extends({\n    ref: ref\n  }, restProps, {\n    // >>> MISC\n    id: mergedId,\n    prefixCls: prefixCls,\n    mode: mergedMultiple ? 'multiple' : undefined // >>> Display Value\n    ,\n\n    displayValues: cachedDisplayValues,\n    onDisplayValuesChange: onDisplayValuesChange // >>> Search\n    ,\n\n    searchValue: mergedSearchValue,\n    onSearch: onInternalSearch // >>> Options\n    ,\n\n    OptionList: OptionList,\n    emptyOptions: !mergedTreeData.length,\n    onDropdownVisibleChange: onInternalDropdownVisibleChange,\n    dropdownMatchSelectWidth: dropdownMatchSelectWidth\n  }))));\n}); // Assign name for Debug\n\nif (process.env.NODE_ENV !== 'production') {\n  TreeSelect.displayName = 'TreeSelect';\n}\nvar GenericTreeSelect = TreeSelect;\nGenericTreeSelect.TreeNode = TreeNode;\nGenericTreeSelect.SHOW_ALL = SHOW_ALL;\nGenericTreeSelect.SHOW_PARENT = SHOW_PARENT;\nGenericTreeSelect.SHOW_CHILD = SHOW_CHILD;\nexport default GenericTreeSelect;","map":{"version":3,"names":["_extends","_toConsumableArray","_objectSpread","_slicedToArray","_objectWithoutProperties","_typeof","_excluded","React","BaseSelect","conductCheck","useId","useMergedState","OptionList","TreeNode","formatStrategyValues","SHOW_ALL","SHOW_PARENT","SHOW_CHILD","TreeSelectContext","LegacyContext","useTreeData","toArray","fillFieldNames","isNil","useCache","useRefFunc","useDataEntities","fillAdditionalInfo","fillLegacyProps","useCheckedKeys","useFilterTreeData","warningProps","warning","isRawValue","value","TreeSelect","forwardRef","props","ref","id","_props$prefixCls","prefixCls","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","_props$autoClearSearc","autoClearSearchValue","filterTreeNode","_props$treeNodeFilter","treeNodeFilterProp","_props$showCheckedStr","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","_props$listHeight","listHeight","_props$listItemHeight","listItemHeight","onDropdownVisibleChange","_props$dropdownMatchS","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","restProps","mergedId","treeConduction","mergedCheckable","mergedLabelInValue","mergedMultiple","_useMergedState","_useMergedState2","internalValue","setInternalValue","process","env","NODE_ENV","mergedFieldNames","useMemo","JSON","stringify","_useMergedState3","undefined","postState","search","_useMergedState4","mergedSearchValue","setSearchValue","onInternalSearch","searchText","mergedTreeData","_useDataEntities","keyEntities","valueEntities","splitRawValues","useCallback","newRawValues","missingRawValues","existRawValues","forEach","val","has","push","filteredTreeData","getLabel","item","titleList","_title","i","length","title","toLabeledValues","draftValues","values","map","convert2LabelValues","rawLabel","label","rawValue","rawHalfChecked","halfChecked","rawDisabled","entity","get","_rawLabel","node","disabled","labelInValueItem","find","labeledItem","rawMixedLabeledValues","_React$useMemo","fullCheckValues","halfCheckValues","_React$useMemo2","rawLabeledValues","rawHalfLabeledValues","rawValues","_useCheckedKeys","_useCheckedKeys2","rawCheckedValues","rawHalfCheckedValues","displayValues","displayKeys","key","_keyEntities$key$node","_keyEntities$key","_keyEntities$key$node2","labeledValues","targetItem","rawDisplayValues","firstVal","_item$label","_useCache","_useCache2","cachedDisplayValues","triggerChange","extra","source","eventValues","formattedKeyList","_ref","triggerValue","selected","returnRawValues","halfValues","filter","includes","concat","returnLabeledValues","additionalInfo","preValue","showPosition","checked","returnValues","onOptionSelect","selectedKey","_ref2","_node$mergedFieldName","selectedValue","v","_splitRawValues","keyList","checkedKeys","_conductCheck","_conductCheck2","halfCheckedKeys","onInternalDropdownVisibleChange","open","legacyParam","Object","defineProperty","onDisplayValuesChange","newValues","info","type","treeSelectContext","legacyContext","checkable","createElement","Provider","mode","emptyOptions","displayName","GenericTreeSelect"],"sources":["/data/messenger.client/node_modules/rc-tree-select/es/TreeSelect.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"id\", \"prefixCls\", \"value\", \"defaultValue\", \"onChange\", \"onSelect\", \"onDeselect\", \"searchValue\", \"inputValue\", \"onSearch\", \"autoClearSearchValue\", \"filterTreeNode\", \"treeNodeFilterProp\", \"showCheckedStrategy\", \"treeNodeLabelProp\", \"multiple\", \"treeCheckable\", \"treeCheckStrictly\", \"labelInValue\", \"fieldNames\", \"treeDataSimpleMode\", \"treeData\", \"children\", \"loadData\", \"treeLoadedKeys\", \"onTreeLoad\", \"treeDefaultExpandAll\", \"treeExpandedKeys\", \"treeDefaultExpandedKeys\", \"onTreeExpand\", \"treeExpandAction\", \"virtual\", \"listHeight\", \"listItemHeight\", \"onDropdownVisibleChange\", \"dropdownMatchSelectWidth\", \"treeLine\", \"treeIcon\", \"showTreeIcon\", \"switcherIcon\", \"treeMotion\"];\nimport * as React from 'react';\nimport { BaseSelect } from 'rc-select';\nimport { conductCheck } from \"rc-tree/es/utils/conductUtil\";\nimport useId from \"rc-select/es/hooks/useId\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport OptionList from \"./OptionList\";\nimport TreeNode from \"./TreeNode\";\nimport { formatStrategyValues, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from \"./utils/strategyUtil\";\nimport TreeSelectContext from \"./TreeSelectContext\";\nimport LegacyContext from \"./LegacyContext\";\nimport useTreeData from \"./hooks/useTreeData\";\nimport { toArray, fillFieldNames, isNil } from \"./utils/valueUtil\";\nimport useCache from \"./hooks/useCache\";\nimport useRefFunc from \"./hooks/useRefFunc\";\nimport useDataEntities from \"./hooks/useDataEntities\";\nimport { fillAdditionalInfo, fillLegacyProps } from \"./utils/legacyUtil\";\nimport useCheckedKeys from \"./hooks/useCheckedKeys\";\nimport useFilterTreeData from \"./hooks/useFilterTreeData\";\nimport warningProps from \"./utils/warningPropsUtil\";\nimport warning from \"rc-util/es/warning\";\n\nfunction isRawValue(value) {\n  return !value || _typeof(value) !== 'object';\n}\n\nvar TreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var id = props.id,\n      _props$prefixCls = props.prefixCls,\n      prefixCls = _props$prefixCls === void 0 ? 'rc-tree-select' : _props$prefixCls,\n      value = props.value,\n      defaultValue = props.defaultValue,\n      onChange = props.onChange,\n      onSelect = props.onSelect,\n      onDeselect = props.onDeselect,\n      searchValue = props.searchValue,\n      inputValue = props.inputValue,\n      onSearch = props.onSearch,\n      _props$autoClearSearc = props.autoClearSearchValue,\n      autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n      filterTreeNode = props.filterTreeNode,\n      _props$treeNodeFilter = props.treeNodeFilterProp,\n      treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'value' : _props$treeNodeFilter,\n      _props$showCheckedStr = props.showCheckedStrategy,\n      showCheckedStrategy = _props$showCheckedStr === void 0 ? SHOW_CHILD : _props$showCheckedStr,\n      treeNodeLabelProp = props.treeNodeLabelProp,\n      multiple = props.multiple,\n      treeCheckable = props.treeCheckable,\n      treeCheckStrictly = props.treeCheckStrictly,\n      labelInValue = props.labelInValue,\n      fieldNames = props.fieldNames,\n      treeDataSimpleMode = props.treeDataSimpleMode,\n      treeData = props.treeData,\n      children = props.children,\n      loadData = props.loadData,\n      treeLoadedKeys = props.treeLoadedKeys,\n      onTreeLoad = props.onTreeLoad,\n      treeDefaultExpandAll = props.treeDefaultExpandAll,\n      treeExpandedKeys = props.treeExpandedKeys,\n      treeDefaultExpandedKeys = props.treeDefaultExpandedKeys,\n      onTreeExpand = props.onTreeExpand,\n      treeExpandAction = props.treeExpandAction,\n      virtual = props.virtual,\n      _props$listHeight = props.listHeight,\n      listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n      _props$listItemHeight = props.listItemHeight,\n      listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n      onDropdownVisibleChange = props.onDropdownVisibleChange,\n      _props$dropdownMatchS = props.dropdownMatchSelectWidth,\n      dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,\n      treeLine = props.treeLine,\n      treeIcon = props.treeIcon,\n      showTreeIcon = props.showTreeIcon,\n      switcherIcon = props.switcherIcon,\n      treeMotion = props.treeMotion,\n      restProps = _objectWithoutProperties(props, _excluded);\n\n  var mergedId = useId(id);\n  var treeConduction = treeCheckable && !treeCheckStrictly;\n  var mergedCheckable = treeCheckable || treeCheckStrictly;\n  var mergedLabelInValue = treeCheckStrictly || labelInValue;\n  var mergedMultiple = mergedCheckable || multiple;\n\n  var _useMergedState = useMergedState(defaultValue, {\n    value: value\n  }),\n      _useMergedState2 = _slicedToArray(_useMergedState, 2),\n      internalValue = _useMergedState2[0],\n      setInternalValue = _useMergedState2[1]; // ========================== Warning ===========================\n\n\n  if (process.env.NODE_ENV !== 'production') {\n    warningProps(props);\n  } // ========================= FieldNames =========================\n\n\n  var mergedFieldNames = React.useMemo(function () {\n    return fillFieldNames(fieldNames);\n  },\n  /* eslint-disable react-hooks/exhaustive-deps */\n  [JSON.stringify(fieldNames)]\n  /* eslint-enable react-hooks/exhaustive-deps */\n  ); // =========================== Search ===========================\n\n  var _useMergedState3 = useMergedState('', {\n    value: searchValue !== undefined ? searchValue : inputValue,\n    postState: function postState(search) {\n      return search || '';\n    }\n  }),\n      _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n      mergedSearchValue = _useMergedState4[0],\n      setSearchValue = _useMergedState4[1];\n\n  var onInternalSearch = function onInternalSearch(searchText) {\n    setSearchValue(searchText);\n    onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);\n  }; // ============================ Data ============================\n  // `useTreeData` only do convert of `children` or `simpleMode`.\n  // Else will return origin `treeData` for perf consideration.\n  // Do not do anything to loop the data.\n\n\n  var mergedTreeData = useTreeData(treeData, children, treeDataSimpleMode);\n\n  var _useDataEntities = useDataEntities(mergedTreeData, mergedFieldNames),\n      keyEntities = _useDataEntities.keyEntities,\n      valueEntities = _useDataEntities.valueEntities;\n  /** Get `missingRawValues` which not exist in the tree yet */\n\n\n  var splitRawValues = React.useCallback(function (newRawValues) {\n    var missingRawValues = [];\n    var existRawValues = []; // Keep missing value in the cache\n\n    newRawValues.forEach(function (val) {\n      if (valueEntities.has(val)) {\n        existRawValues.push(val);\n      } else {\n        missingRawValues.push(val);\n      }\n    });\n    return {\n      missingRawValues: missingRawValues,\n      existRawValues: existRawValues\n    };\n  }, [valueEntities]); // Filtered Tree\n\n  var filteredTreeData = useFilterTreeData(mergedTreeData, mergedSearchValue, {\n    fieldNames: mergedFieldNames,\n    treeNodeFilterProp: treeNodeFilterProp,\n    filterTreeNode: filterTreeNode\n  }); // =========================== Label ============================\n\n  var getLabel = React.useCallback(function (item) {\n    if (item) {\n      if (treeNodeLabelProp) {\n        return item[treeNodeLabelProp];\n      } // Loop from fieldNames\n\n\n      var titleList = mergedFieldNames._title;\n\n      for (var i = 0; i < titleList.length; i += 1) {\n        var title = item[titleList[i]];\n\n        if (title !== undefined) {\n          return title;\n        }\n      }\n    }\n  }, [mergedFieldNames, treeNodeLabelProp]); // ========================= Wrap Value =========================\n\n  var toLabeledValues = React.useCallback(function (draftValues) {\n    var values = toArray(draftValues);\n    return values.map(function (val) {\n      if (isRawValue(val)) {\n        return {\n          value: val\n        };\n      }\n\n      return val;\n    });\n  }, []);\n  var convert2LabelValues = React.useCallback(function (draftValues) {\n    var values = toLabeledValues(draftValues);\n    return values.map(function (item) {\n      var rawLabel = item.label;\n      var rawValue = item.value,\n          rawHalfChecked = item.halfChecked;\n      var rawDisabled;\n      var entity = valueEntities.get(rawValue); // Fill missing label & status\n\n      if (entity) {\n        var _rawLabel;\n\n        rawLabel = (_rawLabel = rawLabel) !== null && _rawLabel !== void 0 ? _rawLabel : getLabel(entity.node);\n        rawDisabled = entity.node.disabled;\n      } else if (rawLabel === undefined) {\n        // We try to find in current `labelInValue` value\n        var labelInValueItem = toLabeledValues(internalValue).find(function (labeledItem) {\n          return labeledItem.value === rawValue;\n        });\n        rawLabel = labelInValueItem.label;\n      }\n\n      return {\n        label: rawLabel,\n        value: rawValue,\n        halfChecked: rawHalfChecked,\n        disabled: rawDisabled\n      };\n    });\n  }, [valueEntities, getLabel, toLabeledValues, internalValue]); // =========================== Values ===========================\n\n  var rawMixedLabeledValues = React.useMemo(function () {\n    return toLabeledValues(internalValue);\n  }, [toLabeledValues, internalValue]); // Split value into full check and half check\n\n  var _React$useMemo = React.useMemo(function () {\n    var fullCheckValues = [];\n    var halfCheckValues = [];\n    rawMixedLabeledValues.forEach(function (item) {\n      if (item.halfChecked) {\n        halfCheckValues.push(item);\n      } else {\n        fullCheckValues.push(item);\n      }\n    });\n    return [fullCheckValues, halfCheckValues];\n  }, [rawMixedLabeledValues]),\n      _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n      rawLabeledValues = _React$useMemo2[0],\n      rawHalfLabeledValues = _React$useMemo2[1]; // const [mergedValues] = useCache(rawLabeledValues);\n\n\n  var rawValues = React.useMemo(function () {\n    return rawLabeledValues.map(function (item) {\n      return item.value;\n    });\n  }, [rawLabeledValues]); // Convert value to key. Will fill missed keys for conduct check.\n\n  var _useCheckedKeys = useCheckedKeys(rawLabeledValues, rawHalfLabeledValues, treeConduction, keyEntities),\n      _useCheckedKeys2 = _slicedToArray(_useCheckedKeys, 2),\n      rawCheckedValues = _useCheckedKeys2[0],\n      rawHalfCheckedValues = _useCheckedKeys2[1]; // Convert rawCheckedKeys to check strategy related values\n\n\n  var displayValues = React.useMemo(function () {\n    // Collect keys which need to show\n    var displayKeys = formatStrategyValues(rawCheckedValues, showCheckedStrategy, keyEntities, mergedFieldNames); // Convert to value and filled with label\n\n    var values = displayKeys.map(function (key) {\n      var _keyEntities$key$node, _keyEntities$key, _keyEntities$key$node2;\n\n      return (_keyEntities$key$node = (_keyEntities$key = keyEntities[key]) === null || _keyEntities$key === void 0 ? void 0 : (_keyEntities$key$node2 = _keyEntities$key.node) === null || _keyEntities$key$node2 === void 0 ? void 0 : _keyEntities$key$node2[mergedFieldNames.value]) !== null && _keyEntities$key$node !== void 0 ? _keyEntities$key$node : key;\n    }); // Back fill with origin label\n\n    var labeledValues = values.map(function (val) {\n      var targetItem = rawLabeledValues.find(function (item) {\n        return item.value === val;\n      });\n      return {\n        value: val,\n        label: targetItem === null || targetItem === void 0 ? void 0 : targetItem.label\n      };\n    });\n    var rawDisplayValues = convert2LabelValues(labeledValues);\n    var firstVal = rawDisplayValues[0];\n\n    if (!mergedMultiple && firstVal && isNil(firstVal.value) && isNil(firstVal.label)) {\n      return [];\n    }\n\n    return rawDisplayValues.map(function (item) {\n      var _item$label;\n\n      return _objectSpread(_objectSpread({}, item), {}, {\n        label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value\n      });\n    });\n  }, [mergedFieldNames, mergedMultiple, rawCheckedValues, rawLabeledValues, convert2LabelValues, showCheckedStrategy, keyEntities]);\n\n  var _useCache = useCache(displayValues),\n      _useCache2 = _slicedToArray(_useCache, 1),\n      cachedDisplayValues = _useCache2[0]; // =========================== Change ===========================\n\n\n  var triggerChange = useRefFunc(function (newRawValues, extra, source) {\n    var labeledValues = convert2LabelValues(newRawValues);\n    setInternalValue(labeledValues); // Clean up if needed\n\n    if (autoClearSearchValue) {\n      setSearchValue('');\n    } // Generate rest parameters is costly, so only do it when necessary\n\n\n    if (onChange) {\n      var eventValues = newRawValues;\n\n      if (treeConduction) {\n        var formattedKeyList = formatStrategyValues(newRawValues, showCheckedStrategy, keyEntities, mergedFieldNames);\n        eventValues = formattedKeyList.map(function (key) {\n          var entity = valueEntities.get(key);\n          return entity ? entity.node[mergedFieldNames.value] : key;\n        });\n      }\n\n      var _ref = extra || {\n        triggerValue: undefined,\n        selected: undefined\n      },\n          triggerValue = _ref.triggerValue,\n          selected = _ref.selected;\n\n      var returnRawValues = eventValues; // We need fill half check back\n\n      if (treeCheckStrictly) {\n        var halfValues = rawHalfLabeledValues.filter(function (item) {\n          return !eventValues.includes(item.value);\n        });\n        returnRawValues = [].concat(_toConsumableArray(returnRawValues), _toConsumableArray(halfValues));\n      }\n\n      var returnLabeledValues = convert2LabelValues(returnRawValues);\n      var additionalInfo = {\n        // [Legacy] Always return as array contains label & value\n        preValue: rawLabeledValues,\n        triggerValue: triggerValue\n      }; // [Legacy] Fill legacy data if user query.\n      // This is expansive that we only fill when user query\n      // https://github.com/react-component/tree-select/blob/fe33eb7c27830c9ac70cd1fdb1ebbe7bc679c16a/src/Select.jsx\n\n      var showPosition = true;\n\n      if (treeCheckStrictly || source === 'selection' && !selected) {\n        showPosition = false;\n      }\n\n      fillAdditionalInfo(additionalInfo, triggerValue, newRawValues, mergedTreeData, showPosition, mergedFieldNames);\n\n      if (mergedCheckable) {\n        additionalInfo.checked = selected;\n      } else {\n        additionalInfo.selected = selected;\n      }\n\n      var returnValues = mergedLabelInValue ? returnLabeledValues : returnLabeledValues.map(function (item) {\n        return item.value;\n      });\n      onChange(mergedMultiple ? returnValues : returnValues[0], mergedLabelInValue ? null : returnLabeledValues.map(function (item) {\n        return item.label;\n      }), additionalInfo);\n    }\n  }); // ========================== Options ===========================\n\n  /** Trigger by option list */\n\n  var onOptionSelect = React.useCallback(function (selectedKey, _ref2) {\n    var _node$mergedFieldName;\n\n    var selected = _ref2.selected,\n        source = _ref2.source;\n    var entity = keyEntities[selectedKey];\n    var node = entity === null || entity === void 0 ? void 0 : entity.node;\n    var selectedValue = (_node$mergedFieldName = node === null || node === void 0 ? void 0 : node[mergedFieldNames.value]) !== null && _node$mergedFieldName !== void 0 ? _node$mergedFieldName : selectedKey; // Never be falsy but keep it safe\n\n    if (!mergedMultiple) {\n      // Single mode always set value\n      triggerChange([selectedValue], {\n        selected: true,\n        triggerValue: selectedValue\n      }, 'option');\n    } else {\n      var newRawValues = selected ? [].concat(_toConsumableArray(rawValues), [selectedValue]) : rawCheckedValues.filter(function (v) {\n        return v !== selectedValue;\n      }); // Add keys if tree conduction\n\n      if (treeConduction) {\n        // Should keep missing values\n        var _splitRawValues = splitRawValues(newRawValues),\n            missingRawValues = _splitRawValues.missingRawValues,\n            existRawValues = _splitRawValues.existRawValues;\n\n        var keyList = existRawValues.map(function (val) {\n          return valueEntities.get(val).key;\n        }); // Conduction by selected or not\n\n        var checkedKeys;\n\n        if (selected) {\n          var _conductCheck = conductCheck(keyList, true, keyEntities);\n\n          checkedKeys = _conductCheck.checkedKeys;\n        } else {\n          var _conductCheck2 = conductCheck(keyList, {\n            checked: false,\n            halfCheckedKeys: rawHalfCheckedValues\n          }, keyEntities);\n\n          checkedKeys = _conductCheck2.checkedKeys;\n        } // Fill back of keys\n\n\n        newRawValues = [].concat(_toConsumableArray(missingRawValues), _toConsumableArray(checkedKeys.map(function (key) {\n          return keyEntities[key].node[mergedFieldNames.value];\n        })));\n      }\n\n      triggerChange(newRawValues, {\n        selected: selected,\n        triggerValue: selectedValue\n      }, source || 'option');\n    } // Trigger select event\n\n\n    if (selected || !mergedMultiple) {\n      onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedValue, fillLegacyProps(node));\n    } else {\n      onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectedValue, fillLegacyProps(node));\n    }\n  }, [splitRawValues, valueEntities, keyEntities, mergedFieldNames, mergedMultiple, rawValues, triggerChange, treeConduction, onSelect, onDeselect, rawCheckedValues, rawHalfCheckedValues]); // ========================== Dropdown ==========================\n\n  var onInternalDropdownVisibleChange = React.useCallback(function (open) {\n    if (onDropdownVisibleChange) {\n      var legacyParam = {};\n      Object.defineProperty(legacyParam, 'documentClickClose', {\n        get: function get() {\n          warning(false, 'Second param of `onDropdownVisibleChange` has been removed.');\n          return false;\n        }\n      });\n      onDropdownVisibleChange(open, legacyParam);\n    }\n  }, [onDropdownVisibleChange]); // ====================== Display Change ========================\n\n  var onDisplayValuesChange = useRefFunc(function (newValues, info) {\n    var newRawValues = newValues.map(function (item) {\n      return item.value;\n    });\n\n    if (info.type === 'clear') {\n      triggerChange(newRawValues, {}, 'selection');\n      return;\n    } // TreeSelect only have multiple mode which means display change only has remove\n\n\n    if (info.values.length) {\n      onOptionSelect(info.values[0].value, {\n        selected: false,\n        source: 'selection'\n      });\n    }\n  }); // ========================== Context ===========================\n\n  var treeSelectContext = React.useMemo(function () {\n    return {\n      virtual: virtual,\n      dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n      listHeight: listHeight,\n      listItemHeight: listItemHeight,\n      treeData: filteredTreeData,\n      fieldNames: mergedFieldNames,\n      onSelect: onOptionSelect,\n      treeExpandAction: treeExpandAction\n    };\n  }, [virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, filteredTreeData, mergedFieldNames, onOptionSelect, treeExpandAction]); // ======================= Legacy Context =======================\n\n  var legacyContext = React.useMemo(function () {\n    return {\n      checkable: mergedCheckable,\n      loadData: loadData,\n      treeLoadedKeys: treeLoadedKeys,\n      onTreeLoad: onTreeLoad,\n      checkedKeys: rawCheckedValues,\n      halfCheckedKeys: rawHalfCheckedValues,\n      treeDefaultExpandAll: treeDefaultExpandAll,\n      treeExpandedKeys: treeExpandedKeys,\n      treeDefaultExpandedKeys: treeDefaultExpandedKeys,\n      onTreeExpand: onTreeExpand,\n      treeIcon: treeIcon,\n      treeMotion: treeMotion,\n      showTreeIcon: showTreeIcon,\n      switcherIcon: switcherIcon,\n      treeLine: treeLine,\n      treeNodeFilterProp: treeNodeFilterProp,\n      keyEntities: keyEntities\n    };\n  }, [mergedCheckable, loadData, treeLoadedKeys, onTreeLoad, rawCheckedValues, rawHalfCheckedValues, treeDefaultExpandAll, treeExpandedKeys, treeDefaultExpandedKeys, onTreeExpand, treeIcon, treeMotion, showTreeIcon, switcherIcon, treeLine, treeNodeFilterProp, keyEntities]); // =========================== Render ===========================\n\n  return /*#__PURE__*/React.createElement(TreeSelectContext.Provider, {\n    value: treeSelectContext\n  }, /*#__PURE__*/React.createElement(LegacyContext.Provider, {\n    value: legacyContext\n  }, /*#__PURE__*/React.createElement(BaseSelect, _extends({\n    ref: ref\n  }, restProps, {\n    // >>> MISC\n    id: mergedId,\n    prefixCls: prefixCls,\n    mode: mergedMultiple ? 'multiple' : undefined // >>> Display Value\n    ,\n    displayValues: cachedDisplayValues,\n    onDisplayValuesChange: onDisplayValuesChange // >>> Search\n    ,\n    searchValue: mergedSearchValue,\n    onSearch: onInternalSearch // >>> Options\n    ,\n    OptionList: OptionList,\n    emptyOptions: !mergedTreeData.length,\n    onDropdownVisibleChange: onInternalDropdownVisibleChange,\n    dropdownMatchSelectWidth: dropdownMatchSelectWidth\n  }))));\n}); // Assign name for Debug\n\nif (process.env.NODE_ENV !== 'production') {\n  TreeSelect.displayName = 'TreeSelect';\n}\n\nvar GenericTreeSelect = TreeSelect;\nGenericTreeSelect.TreeNode = TreeNode;\nGenericTreeSelect.SHOW_ALL = SHOW_ALL;\nGenericTreeSelect.SHOW_PARENT = SHOW_PARENT;\nGenericTreeSelect.SHOW_CHILD = SHOW_CHILD;\nexport default GenericTreeSelect;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,OAAOC,OAAO,MAAM,mCAAmC;AACvD,IAAIC,SAAS,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,oBAAoB,EAA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